﻿using System;
using System.Collections.Generic;
using VisionCloud.Core.Model.Ms;

namespace VisionCloud.Domain.DtoModel.Ms
{
    public class RobotViewModel
    {
        /// <summary>
        /// 机器人ID
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 机器人Token
        /// </summary>
        public string Token { get; set; }

        /// <summary>
        /// 机器人编码
        /// </summary>
        public string DeviceCode { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public MsRobot.RobotTypeEnum Type { get; set; }

        /// <summary>
        /// 类型名
        /// </summary>
        public string TypeName { get; set; }

        /// <summary>
        /// 机器人状态
        /// </summary>
        public MsRobot.EnumRobotStatus Statu { get; set; }

        /// <summary>
        /// 机器人状态
        /// </summary>
        public string StatuName { get; set; }

        /// <summary>
        /// 机器人别名
        /// </summary>
        public string Alias { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedDate { get; set; }

        /// <summary>
        /// 机器自定义属性列表
        /// </summary>
        public List<RobotAttributeViewModel> Attributes { get; set; }

        public String GetId()
        {
            try
            {
                Random r = new Random();
                string str = "";
                for (int i = 0; i < 18; i++)
                {
                    int a = r.Next(0, 10);
                    str += a.ToString();
                }
                return str;
            }
            catch
            {
                return "";
            }
        }
    }
}